import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity('candidates', { schema: 'vote' })
export class Candidates {
  @PrimaryGeneratedColumn({ type: 'int', name: 'id' })
  id: number;

  @Column('varchar', { name: 'name', comment: '候选人名称', length: 255 })
  name: string;

  @Column('tinyint', {
    name: 'gender',
    comment: '性别，0未知，1男，2女',
    default: () => "'0'",
  })
  gender: number;

  @Column('tinyint', {
    name: 'status',
    comment: '状态，0不参选，1参选',
    default: () => "'1'",
  })
  status: number;

  @Column('int', {
    name: 'created_at',
    comment: '创建时间',
    default: () => "'0'",
  })
  createdAt: number;

  @Column('int', {
    name: 'updated_at',
    comment: '更新时间',
    default: () => "'0'",
  })
  updatedAt: number;
}
